package com.darrenchan.spark

import org.codehaus.jackson.map.ObjectMapper
import org.codehaus.jackson.node.ObjectNode

/**
  * @Desc
  * @Author chenchi03
  * @CreateTime 2019-11-20 21:56
  */
object Test2 {
    def main(args: Array[String]): Unit = {
        val objectMapper = new ObjectMapper()
        val arrayNode = objectMapper.createArrayNode()

        val dataNode = objectMapper.createObjectNode()
        dataNode.put("reply_id", 1234)
        dataNode.put("type", 2)
        dataNode.put("word", "haha")
        dataNode.put("count", 56)

        arrayNode.add(dataNode)

        val dataNode2 = objectMapper.createObjectNode()
        dataNode2.put("reply_id", 12341)
        dataNode2.put("type", 21)
        dataNode2.put("word", "haha1")
        dataNode2.put("count", 561)
        arrayNode.add(dataNode)

        val node = objectMapper.createObjectNode()
        node.put("k1", arrayNode)

        println(node.toString)

        val obj = objectMapper.readTree(node.toString)
        println(obj.get("k1").get(0))


        println("".split(",").length)

        for(i <- 0 until 1){
            println(i)
        }

    }
}
